/* ----------------------------------------------------------------------------
* File: quiz_dictionary_impl.h
*
* Desc: Implementation for quiz dictionary
*
* Created: 07/05/2011, by Alexey Korshunov
* ---------------------------------------------------------------------------- */
#ifndef _QUIZ_DICTIONARY_IMPL_H_
#define _QUIZ_DICTIONARY_IMPL_H_

#include "dictionary.h"
#include "exception.h"
#include <vector>


namespace ModuleManagement
{
	class QuizDictionaryManagerImpl : public QuizCore::DictionaryManager
	{
		typedef struct QuestionPair
		{
			std::string question;
			std::string answer;
		}QuestionPair;

		typedef std::vector<QuestionPair*>				VectorQuestions;
		typedef std::vector<QuestionPair*>::iterator	VectorQuestionsIterator;

	public:
		explicit QuizDictionaryManagerImpl(const std::string& FileName)
			throw(Common::Exception);
		~QuizDictionaryManagerImpl();

		virtual void GetDictionaryInfo(QuizCore::DictionaryInfo& info);
		virtual void SetCurNumberQuestion(unsigned int Num);
		virtual const std::string& GetQuestion();
		virtual const std::string& GetAnswer();

	private:
		VectorQuestions m_Questions;
		std::string m_Answer;
		unsigned int m_QuestionId;
	};
}

#endif // _QUIZ_DICTIONARY_IMPL_H_
